Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :-export(mstatistics/0).
- mstatistics:-
- garbage_collect,
- garbage_collect_atoms,
- statistics,
- statistics(stack,Om),O is Om/1000000,
- statistics(clauses,C),
- statistics(memory,[Tm,_]),T is Tm/1000000,
- statistics(atoms,[A,Mm,0]),AM is Mm/1000000,
- OdC is O/C,
- OdA is (A/1000)*39,
- PerAtom is (Mm/A),
- list_new_atoms(L,NA),
- save_atoms,
- fmt((stack/clauses/mem/new + O/C/T/NA = c(OdC)/a(OdA-AM-PerAtom))),!,
- (NA<1000->fmt(L);true).
- current_atom_or_blob(X,atom):-current_atom(X).
- current_atom_or_blob(X,blob(T)):-current_blob(X,T).
- current_atom_or_blob(X,functor):-current_functor(X,_).
- current_atom_or_blob(X,key):-current_key(X).
- current_atom_or_blob(X,flag):-current_key(X).
- :-dynamic(saved_current_atom/1).
- :-export(new_atoms/1).
- new_atoms(X,Type):-current_atom_or_blob(X,Type),not(saved_current_atom(X)).
- :-export(save_atoms/0).
- save_atoms:-forall(new_atoms(X,_Type),assert(saved_current_atom(X))).
- :-export(list_new_atoms/2).
- list_new_atoms(L,NA):-findall(X-Type,new_atoms(X,Type),L),length(L,NA).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement