ruby-prof 1.4.4-x64-mingw-ucrt → 1.4.5-x64-mingw-ucrt

Sign up to get free protection for your applications and to get access to all the features.
@@ -349,7 +349,7 @@ class MeasureMemoryTest < TestCase
349
349
 
350
350
  assert_equal(0.0, method.call_trees.callees.length)
351
351
  end
352
- else
352
+ elsif Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.2')
353
353
  def test_memory
354
354
  result = RubyProf.profile do
355
355
  allocator = Allocator.new
@@ -682,6 +682,351 @@ class MeasureMemoryTest < TestCase
682
682
  assert_equal(0.0, call_tree.self_time)
683
683
  assert_equal(0.0, call_tree.children_time)
684
684
 
685
+ assert_equal(0.0, method.call_trees.callees.length)
686
+ end
687
+ else
688
+ def test_memory
689
+ result = RubyProf.profile do
690
+ allocator = Allocator.new
691
+ allocator.run
692
+ end
693
+
694
+ thread = result.threads.first
695
+
696
+ assert_in_delta(1040, thread.total_time, 1)
697
+ methods = result.threads.first.methods.sort.reverse
698
+ assert_equal(13, methods.length)
699
+
700
+ # Method 0
701
+ method = methods[0]
702
+ assert_equal('MeasureMemoryTest#test_memory', method.full_name)
703
+ assert_in_delta(1040, method.total_time, 1)
704
+
705
+ assert_equal(0.0, method.wait_time)
706
+ assert_equal(0.0, method.self_time)
707
+ assert_in_delta(1040, method.children_time, 1)
708
+ assert_equal(0, method.call_trees.callers.length)
709
+
710
+ assert_equal(2, method.call_trees.callees.length)
711
+ call_tree = method.call_trees.callees[0]
712
+ assert_equal('Class#new', call_tree.target.full_name)
713
+ assert_equal(40.0, call_tree.total_time)
714
+ assert_equal(0.0, call_tree.wait_time)
715
+ assert_equal(40.0, call_tree.self_time)
716
+ assert_equal(0.0, call_tree.children_time)
717
+
718
+ call_tree = method.call_trees.callees[1]
719
+ assert_equal('Allocator#run', call_tree.target.full_name)
720
+ assert_equal(1000.0, call_tree.total_time)
721
+ assert_equal(0.0, call_tree.wait_time)
722
+ assert_equal(0.0, call_tree.self_time)
723
+ assert_equal(1000.0, call_tree.children_time)
724
+
725
+ # Method 1
726
+ method = methods[1]
727
+ assert_equal('Allocator#run',method.full_name)
728
+ assert_equal(1000.0, method.total_time)
729
+ assert_equal(0.0, method.wait_time)
730
+ assert_equal(0.0, method.self_time)
731
+ assert_equal(1000.0, method.children_time)
732
+
733
+ assert_equal(1, method.call_trees.callers.length)
734
+ call_tree = method.call_trees.callers[0]
735
+ assert_equal('MeasureMemoryTest#test_memory', call_tree.parent.target.full_name)
736
+ assert_equal(1000.0, call_tree.total_time)
737
+ assert_equal(0.0, call_tree.wait_time)
738
+ assert_equal(0.0, call_tree.self_time)
739
+ assert_equal(1000.0, call_tree.children_time)
740
+
741
+ assert_equal(3, method.call_trees.callees.length)
742
+ call_tree = method.call_trees.callees[0]
743
+ assert_equal('Allocator#make_arrays', call_tree.target.full_name)
744
+ assert_equal(400.0, call_tree.total_time)
745
+ assert_equal(0.0, call_tree.wait_time)
746
+ assert_equal(0.0, call_tree.self_time)
747
+ assert_equal(400.0, call_tree.children_time)
748
+
749
+ call_tree = method.call_trees.callees[1]
750
+ assert_equal('Allocator#make_hashes', call_tree.target.full_name)
751
+ assert_equal(200.0, call_tree.total_time)
752
+ assert_equal(0.0, call_tree.wait_time)
753
+ assert_equal(0.0, call_tree.self_time)
754
+ assert_equal(200.0, call_tree.children_time)
755
+
756
+ call_tree = method.call_trees.callees[2]
757
+ assert_equal('Allocator#make_strings', call_tree.target.full_name)
758
+ assert_equal(400.0, call_tree.total_time)
759
+ assert_equal(0.0, call_tree.wait_time)
760
+ assert_equal(40.0, call_tree.self_time)
761
+ assert_equal(360.0, call_tree.children_time)
762
+
763
+ # Method 2
764
+ method = methods[2]
765
+ assert_equal('Class#new', method.full_name)
766
+ assert_equal(440.0, method.total_time)
767
+ assert_equal(0.0, method.wait_time)
768
+ assert_equal(280.0, method.self_time)
769
+ assert_equal(160.0, method.children_time)
770
+
771
+ assert_equal(3, method.call_trees.callers.length)
772
+ call_tree = method.call_trees.callers[0]
773
+ assert_equal('MeasureMemoryTest#test_memory', call_tree.parent.target.full_name)
774
+ assert_equal(40.0, call_tree.total_time)
775
+ assert_equal(0.0, call_tree.wait_time)
776
+ assert_equal(40.0, call_tree.self_time)
777
+ assert_equal(0.0, call_tree.children_time)
778
+
779
+ call_tree = method.call_trees.callers[1]
780
+ assert_equal('Allocator#make_hashes', call_tree.parent.target.full_name)
781
+ assert_equal(200.0, call_tree.total_time)
782
+ assert_equal(0.0, call_tree.wait_time)
783
+ assert_equal(200.0, call_tree.self_time)
784
+ assert_equal(0.0, call_tree.children_time)
785
+
786
+ call_tree = method.call_trees.callers[2]
787
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
788
+ assert_equal(200.0, call_tree.total_time)
789
+ assert_equal(0.0, call_tree.wait_time)
790
+ assert_equal(40.0, call_tree.self_time)
791
+ assert_equal(160.0, call_tree.children_time)
792
+
793
+ assert_equal(3, method.call_trees.callees.length)
794
+ call_tree = method.call_trees.callees[0]
795
+ assert_equal('BasicObject#initialize', call_tree.target.full_name)
796
+ assert_equal(0.0, call_tree.total_time)
797
+ assert_equal(0.0, call_tree.wait_time)
798
+ assert_equal(0.0, call_tree.self_time)
799
+ assert_equal(0.0, call_tree.children_time)
800
+
801
+ call_tree = method.call_trees.callees[1]
802
+ assert_equal('Hash#initialize', call_tree.target.full_name)
803
+ assert_equal(0.0, call_tree.total_time)
804
+ assert_equal(0.0, call_tree.wait_time)
805
+ assert_equal(0.0, call_tree.self_time)
806
+ assert_equal(0.0, call_tree.children_time)
807
+
808
+ call_tree = method.call_trees.callees[2]
809
+ assert_equal('String#initialize', call_tree.target.full_name)
810
+ assert_equal(160.0, call_tree.total_time)
811
+ assert_equal(0.0, call_tree.wait_time)
812
+ assert_equal(160.0, call_tree.self_time)
813
+ assert_equal(0.0, call_tree.children_time)
814
+
815
+ # Method 3
816
+ method = methods[3]
817
+ assert_equal('Allocator#make_strings', method.full_name)
818
+ assert_equal(400.0, method.total_time)
819
+ assert_equal(0.0, method.wait_time)
820
+ assert_equal(40.0, method.self_time)
821
+ assert_equal(360.0, method.children_time)
822
+
823
+ assert_equal(1, method.call_trees.callers.length)
824
+ call_tree = method.call_trees.callers[0]
825
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
826
+ assert_equal(400.0, call_tree.total_time)
827
+ assert_equal(0.0, call_tree.wait_time)
828
+ assert_equal(40.0, call_tree.self_time)
829
+ assert_equal(360.0, call_tree.children_time)
830
+
831
+ assert_equal(2, method.call_trees.callees.length)
832
+ call_tree = method.call_trees.callees[0]
833
+ assert_equal('String#*', call_tree.target.full_name)
834
+ assert_equal(160.0, call_tree.total_time)
835
+ assert_equal(0.0, call_tree.wait_time)
836
+ assert_equal(160.0, call_tree.self_time)
837
+ assert_equal(0.0, call_tree.children_time)
838
+
839
+ call_tree = method.call_trees.callees[1]
840
+ assert_equal('Class#new', call_tree.target.full_name)
841
+ assert_equal(200.0, call_tree.total_time)
842
+ assert_equal(0.0, call_tree.wait_time)
843
+ assert_equal(40.0, call_tree.self_time)
844
+ assert_equal(160.0, call_tree.children_time)
845
+
846
+ # Method 4
847
+ method = methods[4]
848
+ assert_equal('Allocator#make_arrays', method.full_name)
849
+ assert_equal(400.0, method.total_time)
850
+ assert_equal(0.0, method.wait_time)
851
+ assert_equal(0.0, method.self_time)
852
+ assert_equal(400.0, method.children_time)
853
+
854
+ assert_equal(1, method.call_trees.callers.length)
855
+ call_tree = method.call_trees.callers[0]
856
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
857
+ assert_equal(400.0, call_tree.total_time)
858
+ assert_equal(0.0, call_tree.wait_time)
859
+ assert_equal(0.0, call_tree.self_time)
860
+ assert_equal(400.0, call_tree.children_time)
861
+
862
+ assert_equal(1, method.call_trees.callees.length)
863
+ call_tree = method.call_trees.callees[0]
864
+ assert_equal('Integer#times', call_tree.target.full_name)
865
+ assert_equal(400.0, call_tree.total_time)
866
+ assert_equal(0.0, call_tree.wait_time)
867
+ assert_equal(0.0, call_tree.self_time)
868
+ assert_equal(400.0, call_tree.children_time)
869
+
870
+ # Method 5
871
+ method = methods[5]
872
+ assert_equal('Integer#times', method.full_name)
873
+ assert_equal(400.0, method.total_time)
874
+ assert_equal(0.0, method.wait_time)
875
+ assert_equal(0.0, method.self_time)
876
+ assert_equal(400.0, method.children_time)
877
+
878
+ assert_equal(1, method.call_trees.callers.length)
879
+ call_tree = method.call_trees.callers[0]
880
+ assert_equal('Allocator#make_arrays', call_tree.parent.target.full_name)
881
+ assert_equal(400.0, call_tree.total_time)
882
+ assert_equal(0.0, call_tree.wait_time)
883
+ assert_equal(0.0, call_tree.self_time)
884
+ assert_equal(400.0, call_tree.children_time)
885
+
886
+ assert_equal(1, method.call_trees.callees.length)
887
+ call_tree = method.call_trees.callees[0]
888
+ assert_equal('<Class::Array>#new', call_tree.target.full_name)
889
+ assert_equal(400.0, call_tree.total_time)
890
+ assert_equal(0.0, call_tree.wait_time)
891
+ assert_equal(400.0, call_tree.self_time)
892
+ assert_equal(0.0, call_tree.children_time)
893
+
894
+ # Method 6
895
+ method = methods[6]
896
+ assert_equal('<Class::Array>#new', method.full_name)
897
+ assert_equal(400.0, method.total_time)
898
+ assert_equal(0.0, method.wait_time)
899
+ assert_equal(400.0, method.self_time)
900
+ assert_equal(0.0, method.children_time)
901
+
902
+ assert_equal(1, method.call_trees.callers.length)
903
+ call_tree = method.call_trees.callers[0]
904
+ assert_equal('Integer#times', call_tree.parent.target.full_name)
905
+ assert_equal(400.0, call_tree.total_time)
906
+ assert_equal(0.0, call_tree.wait_time)
907
+ assert_equal(400.0, call_tree.self_time)
908
+ assert_equal(0.0, call_tree.children_time)
909
+
910
+ assert_equal(1, method.call_trees.callees.length)
911
+ call_tree = method.call_trees.callees[0]
912
+ assert_equal('Array#initialize', call_tree.target.full_name)
913
+ assert_equal(0.0, call_tree.total_time)
914
+ assert_equal(0.0, call_tree.wait_time)
915
+ assert_equal(0.0, call_tree.self_time)
916
+ assert_equal(0.0, call_tree.children_time)
917
+
918
+ # Method 7
919
+ method = methods[7]
920
+ assert_equal('Allocator#make_hashes', method.full_name)
921
+ assert_equal(200.0, method.total_time)
922
+ assert_equal(0.0, method.wait_time)
923
+ assert_equal(0.0, method.self_time)
924
+ assert_equal(200.0, method.children_time)
925
+
926
+ assert_equal(1, method.call_trees.callers.length)
927
+ call_tree = method.call_trees.callers[0]
928
+ assert_equal('Allocator#run', call_tree.parent.target.full_name)
929
+ assert_equal(200.0, call_tree.total_time)
930
+ assert_equal(0.0, call_tree.wait_time)
931
+ assert_equal(0.0, call_tree.self_time)
932
+ assert_equal(200.0, call_tree.children_time)
933
+
934
+ assert_equal(1, method.call_trees.callees.length)
935
+ call_tree = method.call_trees.callees[0]
936
+ assert_equal('Class#new', call_tree.target.full_name)
937
+ assert_equal(200.0, call_tree.total_time)
938
+ assert_equal(0.0, call_tree.wait_time)
939
+ assert_equal(200.0, call_tree.self_time)
940
+ assert_equal(0.0, call_tree.children_time)
941
+
942
+ # Method 8
943
+ method = methods[8]
944
+ assert_equal('String#*', method.full_name)
945
+ assert_equal(160.0, method.total_time)
946
+ assert_equal(0.0, method.wait_time)
947
+ assert_equal(160.0, method.self_time)
948
+ assert_equal(0.0, method.children_time)
949
+
950
+ assert_equal(1, method.call_trees.callers.length)
951
+ call_tree = method.call_trees.callers[0]
952
+ assert_equal('Allocator#make_strings', call_tree.parent.target.full_name)
953
+ assert_equal(160.0, call_tree.total_time)
954
+ assert_equal(0.0, call_tree.wait_time)
955
+ assert_equal(160.0, call_tree.self_time)
956
+ assert_equal(0.0, call_tree.children_time)
957
+
958
+ assert_equal(0.0, method.call_trees.callees.length)
959
+
960
+ # Method 9
961
+ method = methods[9]
962
+ assert_equal('String#initialize', method.full_name)
963
+ assert_equal(160.0, method.total_time)
964
+ assert_equal(0.0, method.wait_time)
965
+ assert_equal(160.0, method.self_time)
966
+ assert_equal(0.0, method.children_time)
967
+
968
+ assert_equal(1, method.call_trees.callers.length)
969
+ call_tree = method.call_trees.callers[0]
970
+ assert_equal('Class#new', call_tree.parent.target.full_name)
971
+ assert_equal(160.0, call_tree.total_time)
972
+ assert_equal(0.0, call_tree.wait_time)
973
+ assert_equal(160.0, call_tree.self_time)
974
+ assert_equal(0.0, call_tree.children_time)
975
+
976
+ assert_equal(0.0, method.call_trees.callees.length)
977
+
978
+ # Method 10
979
+ method = methods[10]
980
+ assert_equal('BasicObject#initialize', method.full_name)
981
+ assert_equal(0.0, method.total_time)
982
+ assert_equal(0.0, method.wait_time)
983
+ assert_equal(0.0, method.self_time)
984
+ assert_equal(0.0, method.children_time)
985
+
986
+ assert_equal(1, method.call_trees.callers.length)
987
+ call_tree = method.call_trees.callers[0]
988
+ assert_equal('Class#new', call_tree.parent.target.full_name)
989
+ assert_equal(0.0, call_tree.total_time)
990
+ assert_equal(0.0, call_tree.wait_time)
991
+ assert_equal(0.0, call_tree.self_time)
992
+ assert_equal(0.0, call_tree.children_time)
993
+
994
+ assert_equal(0.0, method.call_trees.callees.length)
995
+
996
+ # Method 11
997
+ method = methods[11]
998
+ assert_equal('Hash#initialize', method.full_name)
999
+ assert_equal(0.0, method.total_time)
1000
+ assert_equal(0.0, method.wait_time)
1001
+ assert_equal(0.0, method.self_time)
1002
+ assert_equal(0.0, method.children_time)
1003
+
1004
+ assert_equal(1, method.call_trees.callers.length)
1005
+ call_tree = method.call_trees.callers[0]
1006
+ assert_equal('Class#new', call_tree.parent.target.full_name)
1007
+ assert_equal(0.0, call_tree.total_time)
1008
+ assert_equal(0.0, call_tree.wait_time)
1009
+ assert_equal(0.0, call_tree.self_time)
1010
+ assert_equal(0.0, call_tree.children_time)
1011
+
1012
+ assert_equal(0.0, method.call_trees.callees.length)
1013
+
1014
+ # Method 12
1015
+ method = methods[12]
1016
+ assert_equal('Array#initialize', method.full_name)
1017
+ assert_equal(0.0, method.total_time)
1018
+ assert_equal(0.0, method.wait_time)
1019
+ assert_equal(0.0, method.self_time)
1020
+ assert_equal(0.0, method.children_time)
1021
+
1022
+ assert_equal(1, method.call_trees.callers.length)
1023
+ call_tree = method.call_trees.callers[0]
1024
+ assert_equal('<Class::Array>#new', call_tree.parent.target.full_name)
1025
+ assert_equal(0.0, call_tree.total_time)
1026
+ assert_equal(0.0, call_tree.wait_time)
1027
+ assert_equal(0.0, call_tree.self_time)
1028
+ assert_equal(0.0, call_tree.children_time)
1029
+
685
1030
  assert_equal(0.0, method.call_trees.callees.length)
686
1031
  end
687
1032
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-prof
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: x64-mingw-ucrt
6
6
  authors:
7
7
  - Shugo Maeda, Charlie Savage, Roger Pack, Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-18 00:00:00.000000000 Z
11
+ date: 2022-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -86,6 +86,7 @@ files:
86
86
  - ext/ruby_prof/vc/ruby_prof.sln
87
87
  - ext/ruby_prof/vc/ruby_prof.vcxproj
88
88
  - lib/3.1/ruby_prof.so
89
+ - lib/3.2/ruby_prof.so
89
90
  - lib/ruby-prof.rb
90
91
  - lib/ruby-prof/assets/call_stack_printer.html.erb
91
92
  - lib/ruby-prof/assets/call_stack_printer.png
@@ -163,7 +164,7 @@ metadata:
163
164
  bug_tracker_uri: https://github.com/ruby-prof/ruby-prof/issues
164
165
  changelog_uri: https://github.com/ruby-prof/ruby-prof/blob/master/CHANGES
165
166
  documentation_uri: https://ruby-prof.github.io/
166
- source_code_uri: https://github.com/ruby-prof/ruby-prof/tree/v1.4.4
167
+ source_code_uri: https://github.com/ruby-prof/ruby-prof/tree/v1.4.5
167
168
  post_install_message:
168
169
  rdoc_options: []
169
170
  require_paths:
@@ -179,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
180
  - !ruby/object:Gem::Version
180
181
  version: '0'
181
182
  requirements: []
182
- rubygems_version: 3.3.26
183
+ rubygems_version: 3.4.1
183
184
  signing_key:
184
185
  specification_version: 4
185
186
  summary: Fast Ruby profiler